using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region BandMember

	/// <summary>
	/// BandMember object for NHibernate mapped table 'TB_BandMember'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_BandMember", PrimaryKey = "Id" , Columns="Id,BandId,BandsmanId,BandPosition,JoinDate,LeaveDate,isLeave")]
	[Indexed(Index = "BandMember")] 
	public class BandMember
	{
		#region Member Variables
		
		protected int _id;
		protected string _bandPosition;
		protected DateTime _joinDate;
		protected DateTime _leaveDate;
		protected bool _isLeave;
		protected Band _band;
		protected Bandsman _bandsman;

		#endregion

		#region Constructors

		public BandMember() { }

		public BandMember( string bandPosition, DateTime joinDate, DateTime leaveDate, bool isLeave, Band band, Bandsman bandsman )
		{
			this._bandPosition = bandPosition;
			this._joinDate = joinDate;
			this._leaveDate = leaveDate;
			this._isLeave = isLeave;
			this._band = band;
			this._bandsman = bandsman;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandPosition
		{
			get { return _bandPosition; }
			set
			{
				if ( value != null && value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for BandPosition", value, value.ToString());
				_bandPosition = value;
			}
		}

		public virtual DateTime JoinDate
		{
			get { return _joinDate; }
			set { _joinDate = value; }
		}

		public virtual DateTime LeaveDate
		{
			get { return _leaveDate; }
			set { _leaveDate = value; }
		}

		public virtual bool IsLeave
		{
			get { return _isLeave; }
			set { _isLeave = value; }
		}

		public virtual Band Band
		{
			get { return _band; }
			set { _band = value; }
		}

		public virtual Bandsman Bandsman
		{
			get { return _bandsman; }
			set { _bandsman = value; }
		}

		

		#endregion
	}
	#endregion
}